home *** CD-ROM | disk | FTP | other *** search
- Path: news.cid.sco.com!patrick
- From: patrick@sco.com (Patrick Caulfield)
- Newsgroups: comp.lang.c++,comp.os.ms-windows.programmer.win32
- Subject: Re: VC++ 4.0 memory allocation slower than in 2.x!!!
- Date: Tue, 02 Apr 96 10:43:55 GMT
- Organization: SCO Client Integration Division
- Message-ID: <4jr0hm$o29@avon.x.co.uk>
- References: <alanDozpsy.Kn6@netcom.com> <4jgde4$kgo_001@chem.uva.nl>
- NNTP-Posting-Host: patrick.london.sco.com
- X-Newsreader: News Xpress 2.0 Beta #0
-
- In article <4jgde4$kgo_001@chem.uva.nl>, brands@chemeng.chem.uva.nl (Danny
- Brands) wrote:
- >In article <alanDozpsy.Kn6@netcom.com>,
- > alan@netcom.com (Robert Alan Wright) wrote:
- >|I recently posted a request for help in determining why a program which
- >|was simply recompiled on VC++4.0 suddenly ran 3 times slower than the
- >|same one did under VC++ 2.0.
- >|
- >|I went through all the usual steps of making sure that I had the right
- >|compiler/link settings and even built my own version of the MFC
- >|libraries to make sure they were fully optimized.
- >|
- >|Upon further profiling and other exploration, I found out the problem:
- >|THE VC++ 4.0 MEMORY ALLOCATION ROUTINES ARE WAY SLOWER!!!
-
- I think this is due to the thread-safe implementation of the C run-time
- library in VC4 (althouth why the single-threaded one should be the same
- defeats me!)
-
- What I did was to have a heap for each thread (not needed if you are writing a
- single-threaded app) and then allocate memory using
- HeapAlloc(...,HEAP_NO_SERIALIZE), the speed seems to be back to normal if you
- do this.
-
- Hope this is useful.
-
- patrick
-
-
- --
- | Patrick Caulfield | Work: patrick@sco.com |
- | SCO Client Integration Division. | Home: patrick@pandh.demon.co.uk |
- | Vision House, Waterside | |
- | Kirkstall Road | Voice: +44 (113) 251 2284 |
- | Leeds LS4 2QB | FAX: +44 (113) 251 2102 |
- | United Kingdom | |
-
-